from typing import Optional
    
def get_mysql_config(
    db_host: str,
    db_port: int,
    db_user: str,
    db_passwd: str,
    db_database: str,
    db_charset: str,
    db_pool_size: int
) -> dict:
    
    tortoise_orm: dict = {
        "connections": {
            "mysql": {
                "engine": "tortoise.backends.mysql",
                "credentials": {
                    "host": db_host,
                    "port": db_port,
                    "user": db_user,
                    "password": db_passwd,
                    "database": db_database,
                    "charset": db_charset,
                },
                "pool_size": db_pool_size
            }
        },
        "apps": {
            "models": {
                "models": ["app.db_model", "aerich.models"],
                # 设置 key 值 "default" 的数据库连接
                "default_connection": "mysql",
            },
        },
        "use_tz": False,
        "timezone": "Asia/Shanghai",
    }
    return tortoise_orm